package ui.magic.magiclibs.container.Tool;

/**
 * Created by liushiyin on 17-10-12.
 */

public class TimerInfo {

    private long curTime;  //当前时间
    private long lastTime;   //上一次事件
    private int id;   //id号
    private int delay; //定时器延迟

    public boolean isDel() {
        return isDel;
    }

    public void setDel() {
        isDel = false;
    }

    private boolean isDel; //标记删除该定时器

    public String getDescribe() {
        return describe;
    }

    public void setDescribe(String describe) {
        this.describe = describe;
    }

    private String describe;  //定时器描述

    public TimerInfo(){
        curTime=0;
        lastTime=0;
        id=0;
        delay=1000;
        describe="";
        isDel=false;
    }

    public TimerInfo(int id,int delay,long curTime,String describe){
        this.id=id;
        this.delay=delay;
        this.describe=describe;
        this.curTime=curTime;
        this.lastTime=curTime;
        isDel=false;
    }

    public long getLastTime() {
        return lastTime;
    }

    public void setLastTime(long lastTime) {
        this.lastTime = lastTime;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getDelay() {
        return delay;
    }

    public void setDelay(int delay) {
        this.delay = delay;
    }

    public void setCurTime(long curTime){
        this.curTime=curTime;
    }

    public long getCurTime(){
        return curTime;
    }

    public boolean checkExecute(){
       return (curTime-lastTime>delay);
    }
}
